<template>
  <div :class="{'detail': true}">
    <div class="top">
      <span>{{$t('cExport.packing')}}: <span class="text">{{transObj.shipmentNumber}}</span></span>
    </div>
    <div class="center">
      <span>{{$t('cArroval.aog')}}:
        <span style="color:red" class="text" v-if="transObj.aog === 'AOG'">AOG</span>
        <span class="text" v-else>{{$t('cArroval.noAog')}}</span>
      </span>
      <span>{{$t('cTransportSearch.receivePeople')}}: <span class="text">{{transObj.receiver}}</span></span>
    </div>
    <div class="center">
      <span>{{$t('cExport.port')}}: <span class="text">{{transObj.destinationCountry ? transObj.destinationCountry : transObj.destinationHarbor}}</span></span>
    </div>
    <div class="bottom">
      <div>
        <span v-if="wareHouse">{{$t('cExport.allocationDate')}}: <span>{{transObj.assignNotReceiveDate | changeDate}}</span></span>
        <span v-else class="state">{{$t('cExport.exportState')}}: <span>{{transObj.status}}</span></span>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    transObj: {
      type: Object,
      default() {
        return {}
      }
    },
    wareHouse: {
      type: Boolean,
      default() {
        return false
      }
    },
    index: {
      type: Number,
      default: 0
    }
  }
}
</script>

<style scoped>
.detail {
  margin: 2.778vw;
  padding: 1.389vw;
  border: 1px solid rgba(0, 0, 0, .3);
  font-size: 3.889vw;
  border-radius: 5px;
  background-color: white;
  box-shadow: 0 5px 5px -1px rgba(0, 0, 255, .1);
  opacity: 1;
}
.top,.center,.bottom div > span {
  font-weight: 600;
}
.top,.center,.bottom div {
  display: flex;
}
.text {
  font-weight: 500;
}
.top,.center,.bottom {
  display: flex;
}
.top span:nth-child(1) {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow:ellipsis;
}
.top span:nth-child(2) {
  flex: 1;
}
.center span:nth-child(1) {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow:ellipsis;
}
.center span:nth-child(2) {
  flex: 1;
}
.bottom span:nth-child(1) {
  flex: 1;
}
.bottom span:nth-child(2) {
  flex: 1;
}
</style>
